package day01;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class ZT6 {
    public static void main(String[] args) {
        StringBuffer stringBuffer = new StringBuffer();
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        Set<Character> set = new HashSet<>();
        int len = s.length();
        for (int i = 0; i < len; i++) {
            if (!set.contains(s.charAt(i))) {
                stringBuffer.append(s.charAt(i));
                set.add(s.charAt(i));
            }
        }
        if (set.size() == 1) {
            System.out.println(-1);
            return;
        }
        char[] c = stringBuffer.toString().toCharArray();
        HashMap<Character,Character> hashMap = new HashMap<>();
        for (int i = 0; i < c.length - 1; i++) {
            hashMap.put(c[i],c[i + 1]);
        }
        hashMap.put(c[c.length - 1],c[0]);
        StringBuffer t = new StringBuffer();
        for (int i = 0; i < len; i++) {
            t.append(hashMap.get(s.charAt(i)));
        }
        System.out.println(t);
    }
}
